package com.fg.pro.model.trade.dto;

import lombok.Data;

import java.util.List;

@Data
public class GmGoodsDto {

    @Data
    public class GmGoodsRequest {

        public Page paging;

        public GmGoodsRequest gmGoodsRequest(int limit,int offset) {
            Page page = new Page();
            page.setLimit(limit);
            page.setOffset(offset);
            GmGoodsRequest gmGoodsRequest = new GmGoodsRequest();
            gmGoodsRequest.setPaging(page);
            return gmGoodsRequest;
        }

        @Data
        public class Page {
            public int limit;
            public int offset;
        }
    }

    @Data
    public class GmGoodsReponse{
        public List<GmGoodsData> skus;
        public Page paging;

        @Data
        public class GmGoodsData{
            public Long sku_id;
            public Long revision;
            public Long create_time;
            public Long update_time;
            public Long group_id;
            public Long station_id;
            public Long category_id;
            public Long category1_id;
            public Long category2_id;
            public Long category3_id;
            public Long spu_id;
            public Long base_unit_id;
            public String base_unit_name;
            public Long max_unit_id;
            public String name;
            public String name_pinyin_first_letter;
            public String name_pinyin_letter;
            public String customize_code;
            public Integer sku_type;
            public Integer dispatch_type;
            public Long supplier_id;
            public Long production_unit_id;
            public ProductionUnit production_unit;
            public Long purchase_unit_id;
            public Units units;
            public Boolean on_sale;
            public Boolean is_weight;
            public Integer package_calculate_type;
            public Integer package_num;
            public String bar_code;
            public Double min_price;
            public Double max_price;
            public Integer supplier_cooperate_model_type;
            public Integer have_purchase_rule;
            public Long warehouse_id;
            public Long creator_id;
            public String creator_name;
            public Integer purchase_sku_type;
            public Integer sort_num;
            public Integer source;
            public String reference_market_price;
            public Long supply_station_id;
            public Integer sku_batch_type;
            public Long sku_batch_type_effectuate_time;


            @Data
            public class Units{
                public List<UnitData> units;

                @Data
                public class UnitData{
                    public Long unit_id;
                    public String name;
                    public Integer rate;
                    public Long parent_id;
                    public Long creator_id;
                    public String creator_name;
                }
            }

            @Data
            public class ProductionUnit{
                public Long unit_id;
                public String name;
                public Integer rate;
                public Long parent_id;
            }
        }
        @Data
        public class Page{
            public Boolean has_more;
        }
    }

}
